package cn.zhangchg.meituan;

import com.alibaba.fastjson.JSON;

import java.util.*;

public class AService {

    private BService bService;
    private CService cService;

    public List<Integer> get(List<Integer> ids){
        Random random = new Random();
        List<Integer> lists = new ArrayList<>();
        for (int i = 0; i < ids.size(); i++) {
            lists.add(random.nextInt(10) + 1);
        }
        return lists;
    }

    /**
     * 获取酒店id
     * @param partnerIds
     * @return
     */
    public Map<Long,List<Long>> getHotelByParnterId(List<Long> partnerIds){
        Random random = new Random();
        Map<Long,List<Long>> map = new HashMap<>();

        for (Long partnerId : partnerIds) {
            List<Long> list = new ArrayList<>();
            for (int i = 0; i < 10; i++) {
                list.add(random.nextLong() - 1);
            }
            map.put(partnerId,list);
        }
        System.out.println(JSON.toJSONString(map));
        return map;
    }
    /**
     * 获取随机数
     * @return
     */
    public int get(){
        Random random = new Random();
        return random.nextInt(10) + 1;
    }

    public void setBService(BService bService) {
        this.bService = bService;
    }

    public BService getBService() {
        return bService;
    }

    public CService getCService() {
        return cService;
    }

    public void setCService(CService cService) {
        this.cService = cService;
    }
}
